package br.brpv.silvestrin.vendas.domain;

import android.os.Parcel;
import android.os.Parcelable;

public class Item implements Parcelable {
    private String codItem;
	private String name;
	private String codTela;
	
	public Item(String codItem, String name, String codTela) {
		super();
		this.codItem = codItem;
		this.name = name;
		this.codTela = codTela;
	}

    public Item(Parcel in) {
        readFromParcel(in);
    }

    private void readFromParcel(Parcel in) {
        codItem = in.readString();
        name = in.readString();
        codTela = in.readString();
    }

	public String getCodItem() {
		return codItem;
	}

	public String getName() {
		return name;
	}

	public String getCodTela() {
		return codTela;
	}

	@Override
	public String toString() {
		return name;
	}

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(codItem);
        parcel.writeString(name);
        parcel.writeString(codTela);
    }

    public static final Parcelable.Creator<Item> CREATOR =
            new Parcelable.Creator<Item>() {
                public Item createFromParcel(Parcel in) {
                    return new Item(in);
                }

                public Item[] newArray(int size) {
                    return new Item[size];
                }
            };
}
